/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pojo;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 *
 * @author pvhuy
 */
@Entity
@Table(name=NhanVien.TABLE)
public class NhanVien extends Base{
    /**
     * Tên bảng
     */
    public static final String TABLE = "NhanVien";

    /**
     * Cột họ tên
     */
    protected static final String COLUMN_HOTEN = "HoTen";
    private static final int LENGTH_HOTEN = 45;
    @Column(name=COLUMN_HOTEN, length=LENGTH_HOTEN, nullable=false)
    private String hoTen;

    /**
     * Côt Địa chỉ
     */
    protected static final String COLUMN_DIACHI = "DiaChi";
    private static final int LENGTH_DIACHI = 45;
    @Column(name=COLUMN_DIACHI, length=LENGTH_DIACHI, nullable=true)
    private String diaChi;

    /**
     * Cột điện thoại
     */
    protected static final String COLUMN_DIENTHOAI = "DienThoai";
    private static final int LENGTH_DIENTHOAI = 45;
    @Column(name=COLUMN_DIENTHOAI, length=LENGTH_DIENTHOAI, nullable=true)
    private String dienThoai;

    /**
     * Cột lương
     */
    protected static final String COLUMN_LUONGTRONGTHANG = "LuongTrongThang";
    @Column(name=COLUMN_LUONGTRONGTHANG)
    private float luongTrongThang;

    /**
     * Cột loại nhân viên
     */
    protected static final String COLUMN_LOAINHANVIEN = "LoaiNhanVien";
    @ManyToOne(cascade=CascadeType.ALL)
    @JoinColumn(name=COLUMN_LOAINHANVIEN)
    private LoaiNhanVien loaiNhanVien;

    /**
     * @return the hoTen
     */
    public String getHoTen() {
        return hoTen;
    }

    /**
     * @param hoTen the hoTen to set
     */
    public void setHoTen(String hoTen) {
        this.hoTen = hoTen;
    }

    /**
     * @return the diaChi
     */
    public String getDiaChi() {
        return diaChi;
    }

    /**
     * @param diaChi the diaChi to set
     */
    public void setDiaChi(String diaChi) {
        this.diaChi = diaChi;
    }

    /**
     * @return the dienThoai
     */
    public String getDienThoai() {
        return dienThoai;
    }

    /**
     * @param dienThoai the dienThoai to set
     */
    public void setDienThoai(String dienThoai) {
        this.dienThoai = dienThoai;
    }

    /**
     * @return the luongTrongThang
     */
    public float getLuongTrongThang() {
        return luongTrongThang;
    }

    /**
     * @param luongTrongThang the luongTrongThang to set
     */
    public void setLuongTrongThang(float luongTrongThang) {
        this.luongTrongThang = luongTrongThang;
    }

    /**
     * @return the loaiNhanVien
     */
    public LoaiNhanVien getLoaiNhanVien() {
        return loaiNhanVien;
    }

    /**
     * @param loaiNhanVien the loaiNhanVien to set
     */
    public void setLoaiNhanVien(LoaiNhanVien loaiNhanVien) {
        this.loaiNhanVien = loaiNhanVien;
    }


}
